package cn.uyunsky.platform.entity.impl;

import cn.uyunsky.platform.entity.BaseEntity;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;

/**
 * 角色bean,每个角色对应一组交易
 * 
 * @author baiyh
 * @date 2011-1-22
 */
public class PlRole extends BaseEntity {

	private String id;
	
	private String roleDes;

    private Timestamp createDate;

    /**
     * 目前仅有0,1两个值
     * 0 普通用户
     * 1 管理员
     */
	private String flag;//是否管理员

    /**
     * 角色对应的交易列表
     */
	private Set<String> trancode=new HashSet<String>();

    /**
     * 此角色下的用户
     */
	private Set<PlUser> users=new HashSet<PlUser>();

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getRoleDes() {
		return roleDes;
	}

	public void setRoleDes(String roleDes) {
		this.roleDes = roleDes;
	}

    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    public Set<String> getTrancode() {
		return trancode;
	}

	public void setTrancode(Set<String> trancode) {
		this.trancode = trancode;
	}

	public void addTrancode(String code) {
		trancode.add(code);
	}

	public Set<PlUser> getUsers() {
		return users;
	}

	public void setUsers(Set<PlUser> users) {
		this.users = users;
	}
	
	public void addUser(PlUser user) {
		this.users.add(user);
	}
	
	public String getFlag() {
		return flag;
	}

	public void setFlag(String flag) {
		this.flag = flag;
	}
}
